﻿@model Cafeteria.Models.Compra.Ordencompra.OrdencompraBean

@{
    ViewBag.Title = "Listar Nota Entrada";
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

 
 @using (Html.BeginForm("", "OrdenCompra", FormMethod.Post, new { @class = "form" }))
 { 
    <fieldset>
        <div class="widget">
            <div class="title">
                <h6>Notas de Entrada</h6>
            </div>
            <div class="formRow"> @Html.LabelFor(model => model.nombreProveedor)
                <div class=" formRight">  @Html.DisplayFor(model => model.nombreProveedor) @Html.HiddenFor(model => model.nombreProveedor) </div>
                <div class="clear"></div>
            </div>
             <div class="formRow"> @Html.LabelFor(model => model.nombreSucursal)
                <div class=" formRight">  @Html.DisplayFor(model => model.nombreSucursal) @Html.HiddenFor(model => model.nombreSucursal) </div>
                <div class="clear"></div>
            </div>
            
            <div class="formRow"> @Html.LabelFor(model => model.fecha)
                <div class=" formRight">  @Html.DisplayFor(model => model.fecha) @Html.HiddenFor(model => model.fecha)  </div>
                <div class="clear"></div>
            </div>
            <div class="formRow"> @Html.LabelFor(model => model.estado)
                <div class=" formRight">  @Html.DisplayFor(model => model.estado) @Html.HiddenFor(model => model.estado)  </div>
                <div class="clear"></div>
            </div>
            
        </div>
    </fieldset>
    
     if (Model.estado != "Atendido")
     {
        <p>
        <a href="@Url.Action("RegistrarNotaEntrada", new { id = Model.idOrdenCompra })"><img src="../../Content/images/icons/color/plus.png", alt="Create" />Registrar Nota entrada</a>
        </p>
     }
     
<div class="wrapper">
    <div class="widget">
      <div class="title">
      <h6>Notas de entrada que tiene la Orden de Compra</h6>
      </div>
      
      <div class="dataTables_wrapper">
            
            <table cellpadding = "0" cellspacing = "0" width = "100%" class = "display dTable">
    <thead>
        <tr>
            <th class="ui-state-default" rowspan="1" colspan="1" style="width:150px;" >
                <div class="DataTables_sort_wrapper">
                IdNotaentrada
                <span class="DataTables_sort_icon css_right ui-icon ui-icon-triangle-1-s"></span>
                </div>
             </th>
             <th class="ui-state-default" rowspan="1" colspan="1" style="width:100px;" >
                <div class="DataTables_sort_wrapper">
                Fecha Emitida
                <span class="DataTables_sort_icon css_right ui-icon ui-icon-triangle-1-s"></span>
                </div>
             </th>
            <th class="ui-state-default" rowspan="1" colspan="1" style="width:100px;" >
                <div class="DataTables_sort_wrapper">
                Opciones
                <span class="DataTables_sort_icon css_right ui-icon ui-icon-triangle-1-s"></span>
                </div>
             </th>
        </tr>
    </thead>

    <tbody>
             @for (int i = 0; (i < Model.notasentrada.Count); i++)
                {

                    <tr class="gradeA odd">       
                
                        <td class="formRow"> @Html.DisplayFor(model => model.notasentrada[i].idGuiaRemision)  @Html.HiddenFor(model => model.notasentrada[i].idGuiaRemision) </td>
                        <td class="formRow"> @Html.DisplayFor(model => model.notasentrada[i].fechaEmitida) @Html.HiddenFor(model => model.notasentrada[i].fechaEmitida) </td>
                        <td class="formRow"> 
                           <a href="@Url.Action("DetallenotaEntrada", new { id = Model.notasentrada[i].idGuiaRemision, id2 = Model.idOrdenCompra })"><img src="../../Content/images/icons/color/pencil.png", alt="Edit" />Detalle </a>
                        </td>
                    </tr>
                }
    </tbody>
    </table>
    </div> 
   </div>
</div>
     
    <p>
        @Html.ActionLink("Regresar", "Buscar", "OrdenCompra")
    </p>

 }